package obj.day5;

/**
 * @author げっしょく
 * @date 2021/7/20
 */
public class Test5 {
    public static void main(String[] args) {
        int he = getAdd(1);
        System.out.println(he);
        int ce = getCe(1);
        System.out.println(ce);
    }

    private static int getCe(int i) {
        if(i ==5){
            return 5;
        }
        return i * getCe(i + 1);
    }

    private static int getAdd(int i) {
        if(i == 100){
            return 100;
        }
        return i + getAdd(i + 1);
    }
}
